Skip to content

Don't fail job when non zero terminated exit code - #1411

Merged
AaronH88 merged 3 commits into
ansible:develfrom
matoval:dont-fail-job-non-zero-exit
Aug 14, 2025
Merged

Don't fail job when non zero terminated exit code#1411
AaronH88 merged 3 commits into
ansible:develfrom
matoval:dont-fail-job-non-zero-exit

Conversation

@matoval

@matoval matoval commented Aug 13, 2025

Copy link
Copy Markdown
Collaborator

Don't fail job when non zero terminated exit code, update tests to ensure last line is read if not empty

@codecov

codecov Bot commented Aug 13, 2025

Copy link
Copy Markdown

Codecov Report

✅ All modified and coverable lines are covered by tests.
✅ Project coverage is 55.70%. Comparing base (e72f23a) to head (106bd66).
⚠️ Report is 38 commits behind head on devel.

@@            Coverage Diff             @@
##            devel    #1411      +/-   ##
==========================================
- Coverage   55.95%   55.70%   -0.26%     
==========================================
  Files          60       63       +3     
  Lines        9956    10529     +573     
==========================================
+ Hits         5571     5865     +294     
- Misses       4095     4371     +276     
- Partials      290      293       +3     
Files with missing lines Coverage Δ
pkg/workceptor/kubernetes.go 58.45% <100.00%> (-0.67%) ⬇️

... and 6 files with indirect coverage changes

Components Coverage Δ
Go 55.85% <100.00%> (-0.11%) ⬇️
Receptorctl 53.10% <ø> (∅)
🚀 New features to boost your workflow:
  • ❄️ Test Analytics: Detect flaky tests, report on failures, and find test suite problems.

@davemulford davemulford left a comment

Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Great tests and I really like the comment explaining what's happening there. Minor misspelling. Looks good otherwise!

Comment thread pkg/workceptor/kubernetes.go Outdated
@davemulford
davemulford self-requested a review August 13, 2025 20:06

@davemulford davemulford left a comment

Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

LGTM!

@dleehr dleehr left a comment

Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Great work, love the new tests. Had a couple of suggestions about comments that don't match the logic anymore and a question around eofReadCloser behavior.

I'm currently testing my suggested change to eofReadCloser, will sync on that.

Comment thread pkg/workceptor/kubernetes.go Outdated
Comment thread pkg/workceptor/kubernetes.go Outdated
Comment thread pkg/workceptor/kubernetes.go Outdated
Comment thread pkg/workceptor/kubernetes.go
Comment thread pkg/workceptor/kubernetes_test.go Outdated
Comment thread pkg/workceptor/kubernetes_test.go Outdated
Comment thread pkg/workceptor/kubernetes_test.go
@sonarqubecloud

Copy link
Copy Markdown

@dleehr dleehr left a comment

Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

LGTM 🎉

@lranjbar lranjbar left a comment

Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

With these PRs for the escalation's we have now recreated the logic of PodContainerHealthy(). I think it is time to look at calling this function instead of leaving the logic in RunWorkWithLogger()

@dleehr

dleehr commented Aug 13, 2025

Copy link
Copy Markdown
Contributor

With these PRs for the escalation's we have now recreated the logic of PodContainerHealthy(). I think it is time to look at calling this function instead of leaving the logic in RunWorkWithLogger()

Thank you for your review @lranjbar. I agree that it is a better practice to use a specific helper like PodContainerHealthy() and I see that it was added in #1371 over a month ago but was not discussed for this effort.

I've been engaged in this review and #1400, so I took a look at PodContainerHealthy to see how it could fit here. While it's a good abstraction of our operational logic prior to #1400 (with some additional checks), it's not a drop-in replacement for the logic that has been iterated on, tested, and reviewed in #1400 / #1411. At a glance, there are differences to handling exit codes and Ready that don't align. These are areas the team has focused a great deal on, and they are critical to our response here.

Our priority with this PR is to get our updated logic in a build out for testing and feedback (and be ready to incorporate that feedback). I'm totally onboard with refactoring after we confirm a fix, but before is premature in my opinion. So I don't think we should refactor this to use PodContainerHealthy() at this time.

The good news is that once we deliver a build that addresses issues, we can confidently abstract them into pod.go. What do you think?

Edit: Since you're more familiar with PodContainerHealthy(), do you think it would provide an improvement over the logic we have here? I meant to ask that up front.

@lranjbar

lranjbar commented Aug 14, 2025

Copy link
Copy Markdown
Contributor

With these PRs for the escalation's we have now recreated the logic of PodContainerHealthy(). I think it is time to look at calling this function instead of leaving the logic in RunWorkWithLogger()

Thank you for your review @lranjbar. I agree that it is a better practice to use a specific helper like PodContainerHealthy() and I see that it was added in #1371 over a month ago but was not discussed for this effort.

I've been engaged in this review and #1400, so I took a look at PodContainerHealthy to see how it could fit here. While it's a good abstraction of our operational logic prior to #1400 (with some additional checks), it's not a drop-in replacement for the logic that has been iterated on, tested, and reviewed in #1400 / #1411. At a glance, there are differences to handling exit codes and Ready that don't align. These are areas the team has focused a great deal on, and they are critical to our response here.

Our priority with this PR is to get our updated logic in a build out for testing and feedback (and be ready to incorporate that feedback). I'm totally onboard with refactoring after we confirm a fix, but before is premature in my opinion. So I don't think we should refactor this to use PodContainerHealthy() at this time.

The good news is that once we deliver a build that addresses issues, we can confidently abstract them into pod.go. What do you think?

Edit: Since you're more familiar with PodContainerHealthy(), do you think it would provide an improvement over the logic we have here? I meant to ask that up front.

It was brought up several times before any pull request was made by two team members.

The fact that you chose to dismiss that multiple times means that you made a third team member recreate the identical logic in the hero function. Instead of using the functions that were made a month ago, for this purpose.

That discussion was before #1399, #1400 and #1411 even existed. Now is the time.

@AaronH88

Copy link
Copy Markdown
Contributor

The temperature is rather high on this one,

I am not seeing the advantage of delaying merging this.

We will revisit how we can refactor interacting with Pods and Containers into a more generalised solution, taking into account the work already done in that space.
Given the Sev 1 is already a week old, and we have a fully tested and reviewed PR here, I am more comfortable accepting the risk of potential code duplication rather than accepting the risk of new tests and a refactor of PodContainerHealthy()

Once we have the customers back to green we will revisit 😄

@AaronH88
AaronH88 merged commit 306c945 into ansible:devel Aug 14, 2025
26 of 27 checks passed
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

5 participants